package com.example.util;

import cn.hutool.http.HttpRequest;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * @ClassName HttpTool
 * @Description TODO
 * @Author kun
 * @Date 2024-10-22 11:19
 * @Version 1.0
 */
@Component
public class HttpTool {

    /**
     * post请求
     * @param url
     * @param postData
     * @param headers
     * @return
     */
    public String post(String url,  Map<String,String> headers,String postData){
        return HttpRequest.post(url).body(postData).addHeaders(headers).execute().body();
    }

}
